<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    function add(a, b) {
      let res = "";
      let c = 0;
      a = a.split("");
      b = b.split("");
      while (a.length || b.length || c) {
        c += ~~a.pop() + ~~b.pop();
        res = (c % 10) + res;
        c = c > 9;
      }
      return res.replace(/^0+/, "");
    }
    let a = "99";
    let b = "1";
    console.log(add(a, b));
  </script>
</html>
